#!/usr/bin/env bash

base_dir="$(cd "$(dirname "$0")" && pwd -P)"
omnisharp_dir=${base_dir}/omnisharp

mono_cmd=mono
omnisharp_cmd=${omnisharp_dir}/OmniSharp.exe

no_omnisharp=false

if [ "$1" = "--no-omnisharp" ]; then
    shift
    no_omnisharp=true
fi

if [ "$no_omnisharp" = true ]; then
    "${mono_cmd}" "$@"
else
    "${mono_cmd}" "${omnisharp_cmd}" "$@"
fi
